{% extends '::base.html.twig' %}
{% block title %}Edición de carrera{% endblock %}

{% block greensectiontitle %}Carrera{% endblock %}
{% block greensectionbody %}

<form id="editForm" action="{{ entity.id ? path('carrera_update', { 'id': entity.id }) : path('carrera_create') }}" method="post" {{ form_enctype(edit_form) }}>

<form id="editForm" action="{{ entity.id ? path('carrera_update', { 'id': entity.id }) : path('carrera_create') }}" method="post" {{ form_enctype(edit_form) }}>

   
    {{ form_errors(edit_form.codigo) }}
    {{ form_errors(edit_form.nombre) }}
   
    
    <h5 style="color: red">* Campos Obligatorios</h5>
     
    {{ form_row(edit_form.universidad) }}
    
    <div style="color: red">
    {{ form_label(edit_form.codigo,'Codigo') }} {{ form_widget(edit_form.codigo) }}*<cn style = "color: black" > (solo números y letras)</cn></br>
    {{ form_label(edit_form.codigo,'Nombre') }} {{ form_widget(edit_form.nombre) }}*<cn style = "color: black" > (solo letras)</cn></br>
    </div>
 
 
  
    <div id="controls">
        <a title="Guardar la carrera creada" id="saveButton" href="#">Guardar</a>
        <a title="Cancelar y volver a la lista de carreras" href="{{ path('carrera') }}">Cancelar</a>
    </div>

    
 {{ form_rest(edit_form) }}

</form>
  
{% endblock %}
{% block javascripts %}
<script type="text/javascript"> 
 $(document).ready( function() {
    $.ajax({
        type: "GET",
        data: "data=3",
        url:"{{ path('_universidadById') }}",
        success: function(msg){
            if (msg != ''){
               jQuery('#unl_homologacionbundle_carreratype_universidad').html(msg).show();
               
               }
               else
               {
                   jQuery('#unl_homologacionbundle_carreratype_universidad').html('<em>No hay universidades<em>');
               }
           }
       });
    });
</script>
{% endblock %}